package pck_Service01;

import android.util.Log;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import mainSrc.GlobalData;
import pck_ImageLoader.ImageLoadManager;

public class service_ServiceGlobal
{
  public static int StatePoint;
  public static long Timer;
  public static long TimerA;
  public static boolean bRecycle = false;
  public static boolean bRecycleEnd = false;
  public static int iAnimaPose00;
  public static int iAnimaPose00Interval;
  public static int iAnimaPose00Loop;
  public static int iAnimaPose00Num;
  public static int iAnimaPose01;
  public static int iAnimaPose01Interval;
  public static int iAnimaPose01Loop;
  public static int iAnimaPose01Num;
  public static int iAnimaPose02;
  public static int iAnimaPose02Interval;
  public static int iAnimaPose02Loop;
  public static int iAnimaPose02Num;
  public static int iAnimaPose03;
  public static int iAnimaPose03Interval;
  public static int iAnimaPose03Loop;
  public static int iAnimaPose03Num;
  public static int iAnimaPose04;
  public static int iAnimaPose04Interval;
  public static int iAnimaPose04Loop;
  public static int iAnimaPose04Num;
  public static int iAnimaPose05;
  public static int iAnimaPose05Interval = 10;
  public static int iAnimaPose05Loop = 0;
  public static int iAnimaPose05Num;
  public static int iAnimaPoseNumber;
  public static int iDrop;
  public static int iLeft;
  public static int iLeft_Move;
  public static int iLeft_MoveInterval;
  public static int iLeft_MoveNum;
  public static int iRight;
  public static int iRight_Move;
  public static int iSumOfBitmapNumber = 18;
  public static int iTop;
  public static int iTopMove;
  public static int iTopMoveInterval;
  public static int iTopMoveNum;
  public static int iTouch;
  public static int iWalkInterval;
  public static int iWalkNum;
  public static int iWalk_Left = 0;
  public static int iWalk_Right = 0;
  public static service_Character m_Character;
  public static service_TopView m_TopView;
  
  static
  {
    iWalkNum = 4;
    iWalkInterval = 10;
    iTop = 0;
    iTopMove = 0;
    iTopMoveNum = 2;
    iTopMoveInterval = 20;
    iDrop = 0;
    iTouch = 0;
    iLeft = 0;
    iRight = 0;
    iLeft_Move = 0;
    iLeft_MoveNum = 2;
    iLeft_MoveInterval = 20;
    iRight_Move = 0;
    iAnimaPoseNumber = 2;
    iAnimaPose00 = 0;
    iAnimaPose00Num = 4;
    iAnimaPose00Interval = 10;
    iAnimaPose00Loop = 1;
    iAnimaPose01 = 0;
    iAnimaPose01Num = 1;
    iAnimaPose01Interval = 10;
    iAnimaPose01Loop = 1;
    iAnimaPose02 = 0;
    iAnimaPose02Num = 1;
    iAnimaPose02Interval = 10;
    iAnimaPose02Loop = 0;
    iAnimaPose03 = 0;
    iAnimaPose03Num = 1;
    iAnimaPose03Interval = 10;
    iAnimaPose03Loop = 0;
    iAnimaPose04 = 0;
    iAnimaPose04Num = 1;
    iAnimaPose04Interval = 10;
    iAnimaPose04Loop = 0;
    iAnimaPose05 = 0;
    iAnimaPose05Num = 1;
  }
  
  public service_ServiceGlobal()
  {
    SetData();
  }
  
  public static int AnimationNum(int paramInt1, int paramInt2)
  {
    if ((paramInt2 == 0) || (paramInt1 == 0)) {
      return 0;
    }
    if (Timer - TimerA > 1000L)
    {
      TimerA = Timer;
      return 0;
    }
    return (int)((Timer - TimerA) % (paramInt1 * paramInt2) / paramInt2);
  }
  
  public static void AnimationNum_New()
  {
    TimerA = Timer;
  }
  
  public static int GetDataFromImageName(String paramString)
  {
    ImageLoadManager localImageLoadManager = new ImageLoadManager();
    int i = 1;
    for (;;)
    {
      if (i > 99) {
        return 0;
      }
      if (!localImageLoadManager.CheckDirectoryExists("Character" + Make00Number(GlobalData.GetInstance().character_num), paramString + Make00Number(i) + ".png")) {
        return i - 1;
      }
      i += 1;
    }
  }
  
  public static void LoadCharacterDataFromImageName()
  {
    ImageLoadManager localImageLoadManager = new ImageLoadManager();
    localImageLoadManager.GetDirectory("Character" + Make00Number(GlobalData.GetInstance().character_num), "CharacterStatus.dat");
    iWalk_Left = 0;
    iWalk_Right = 0;
    iWalkNum = GetDataFromImageName("char_walk_left");
    iWalkInterval = 15;
    iTop = 0;
    iTopMove = 0;
    iDrop = 0;
    iTouch = 0;
    iLeft = 0;
    iRight = 0;
    iLeft_Move = 0;
    iRight_Move = 0;
    iLeft_MoveNum = GetDataFromImageName("char_left_move");
    iLeft_MoveInterval = 15;
    iTopMoveNum = GetDataFromImageName("char_top_move");
    iTopMoveInterval = 15;
    if (localImageLoadManager.CheckDirectoryExists("Character" + Make00Number(GlobalData.GetInstance().character_num), "char_pose05_01.png")) {
      iAnimaPoseNumber = 6;
    }
    for (;;)
    {
      iAnimaPose00 = 0;
      iAnimaPose00Num = GetDataFromImageName("char_default");
      iAnimaPose00Interval = 15;
      iAnimaPose00Loop = 1;
      iAnimaPose01 = 0;
      iAnimaPose01Num = GetDataFromImageName("char_pose01_");
      iAnimaPose01Interval = 15;
      iAnimaPose01Loop = 1;
      iAnimaPose02 = 0;
      iAnimaPose02Num = GetDataFromImageName("char_pose02_");
      iAnimaPose02Interval = 15;
      iAnimaPose02Loop = 1;
      iAnimaPose03 = 0;
      iAnimaPose03Num = GetDataFromImageName("char_pose03_");
      iAnimaPose03Interval = 15;
      iAnimaPose03Loop = 1;
      iAnimaPose04 = 0;
      iAnimaPose04Num = GetDataFromImageName("char_pose04_");
      iAnimaPose04Interval = 15;
      iAnimaPose04Loop = 1;
      iAnimaPose05 = 0;
      iAnimaPose05Num = GetDataFromImageName("char_pose05_");
      iAnimaPose05Interval = 15;
      iAnimaPose05Loop = 1;
      iWalk_Left = 0;
      int i = 0 + iWalkNum;
      iWalk_Right = i;
      i += iWalkNum;
      iTop = i;
      i += 1;
      iTopMove = i;
      i += iTopMoveNum;
      iDrop = i;
      i += 1;
      iTouch = i;
      i += 1;
      iLeft = i;
      i += 1;
      iLeft_Move = i;
      i += iLeft_MoveNum;
      iRight = i;
      i += 1;
      iRight_Move = i;
      i += iLeft_MoveNum;
      iAnimaPose00 = i;
      i += iAnimaPose00Num;
      iAnimaPose01 = i;
      i += iAnimaPose01Num;
      iAnimaPose02 = i;
      i += iAnimaPose02Num;
      iAnimaPose03 = i;
      i += iAnimaPose03Num;
      iAnimaPose04 = i;
      i += iAnimaPose04Num;
      iAnimaPose05 = i;
      iSumOfBitmapNumber = i + iAnimaPose05Num;
      ShowLoadDataByLog();
      return;
      if (localImageLoadManager.CheckDirectoryExists("Character" + Make00Number(GlobalData.GetInstance().character_num), "char_pose04_01.png")) {
        iAnimaPoseNumber = 5;
      } else if (localImageLoadManager.CheckDirectoryExists("Character" + Make00Number(GlobalData.GetInstance().character_num), "char_pose03_01.png")) {
        iAnimaPoseNumber = 4;
      } else if (localImageLoadManager.CheckDirectoryExists("Character" + Make00Number(GlobalData.GetInstance().character_num), "char_pose02_01.png")) {
        iAnimaPoseNumber = 3;
      } else if (localImageLoadManager.CheckDirectoryExists("Character" + Make00Number(GlobalData.GetInstance().character_num), "char_pose01_01.png")) {
        iAnimaPoseNumber = 2;
      } else {
        iAnimaPoseNumber = 1;
      }
    }
  }
  
  public static void LoadCharacterDataFromTxtFile()
  {
    try
    {
      Object localObject = new ImageLoadManager();
      ((ImageLoadManager)localObject).GetDirectory("Character" + Make00Number(GlobalData.GetInstance().character_num), "CharacterStatus.dat");
      Log.v("test", "-= 해당 경로에 있는 파일을 불러옵니다 =-");
      Log.v("test", ((ImageLoadManager)localObject).GetDirectory("Character" + Make00Number(GlobalData.GetInstance().character_num), "CharacterStatus.dat"));
      localObject = new FileInputStream(new File(((ImageLoadManager)localObject).GetDirectory("Character" + Make00Number(GlobalData.GetInstance().character_num), "CharacterStatus.dat")));
      iWalk_Left = 0;
      iWalk_Right = 0;
      iWalkNum = GetDataFromImageName("char_walk_left");
      iWalkInterval = ((FileInputStream)localObject).read();
      iTop = 0;
      iTopMove = 0;
      iDrop = 0;
      iTouch = 0;
      iLeft = 0;
      iRight = 0;
      iLeft_Move = 0;
      iRight_Move = 0;
      iLeft_MoveNum = GetDataFromImageName("char_left_Move");
      iLeft_MoveInterval = ((FileInputStream)localObject).read();
      iTopMoveNum = GetDataFromImageName("char_Top_Move");
      iTopMoveInterval = ((FileInputStream)localObject).read();
      iAnimaPoseNumber = ((FileInputStream)localObject).read();
      iAnimaPose00 = 0;
      iAnimaPose00Num = GetDataFromImageName("char_default");
      iAnimaPose00Interval = ((FileInputStream)localObject).read();
      iAnimaPose00Loop = ((FileInputStream)localObject).read();
      iAnimaPose01 = 0;
      iAnimaPose01Num = GetDataFromImageName("char_pose01_");
      iAnimaPose01Interval = ((FileInputStream)localObject).read();
      iAnimaPose01Loop = ((FileInputStream)localObject).read();
      iAnimaPose02 = 0;
      iAnimaPose02Num = GetDataFromImageName("char_pose02_");
      iAnimaPose02Interval = ((FileInputStream)localObject).read();
      iAnimaPose02Loop = ((FileInputStream)localObject).read();
      iAnimaPose03 = 0;
      iAnimaPose03Num = GetDataFromImageName("char_pose03_");
      iAnimaPose03Interval = ((FileInputStream)localObject).read();
      iAnimaPose03Loop = ((FileInputStream)localObject).read();
      iAnimaPose04 = 0;
      iAnimaPose04Num = GetDataFromImageName("char_pose04_");
      iAnimaPose04Interval = ((FileInputStream)localObject).read();
      iAnimaPose04Loop = ((FileInputStream)localObject).read();
      iAnimaPose05 = 0;
      iAnimaPose05Num = GetDataFromImageName("char_pose05_");
      iAnimaPose05Interval = ((FileInputStream)localObject).read();
      iAnimaPose05Loop = ((FileInputStream)localObject).read();
      iWalk_Left = 0;
      int i = 0 + iWalkNum;
      iWalk_Right = i;
      i += iWalkNum;
      iTop = i;
      i += 1;
      iTopMove = i;
      i += iTopMoveNum;
      iDrop = i;
      i += 1;
      iTouch = i;
      i += 1;
      iLeft = i;
      i += 1;
      iLeft_Move = i;
      i += iLeft_MoveNum;
      iRight = i;
      i += 1;
      iRight_Move = i;
      i += iLeft_MoveNum;
      iAnimaPose00 = i;
      i += iAnimaPose00Num;
      iAnimaPose01 = i;
      i += iAnimaPose01Num;
      iAnimaPose02 = i;
      i += iAnimaPose02Num;
      iAnimaPose03 = i;
      i += iAnimaPose03Num;
      iAnimaPose04 = i;
      i += iAnimaPose04Num;
      iAnimaPose05 = i;
      iSumOfBitmapNumber = i + iAnimaPose05Num;
      ShowLoadDataByLog();
      ((FileInputStream)localObject).close();
      return;
    }
    catch (FileNotFoundException localFileNotFoundException)
    {
      Log.v("test", "Load도중 FileNotFoundException이 발생하였습니다.");
      return;
    }
    catch (Exception localException)
    {
      Log.v("test", "Load도중 Exception이 발생하였습니다. : " + localException);
    }
  }
  
  public static String Make00Number(int paramInt)
  {
    if (paramInt >= 10) {
      return paramInt;
    }
    return "0" + paramInt;
  }
  
  public static void SetData()
  {
    Log.v("test", "ServiceGlobal Created --------------- Number : " + Make00Number(GlobalData.GetInstance().character_call));
    if (new ImageLoadManager().CheckDirectoryExists("Character" + Make00Number(GlobalData.GetInstance().character_num), "CharacterStatus.dat"))
    {
      LoadCharacterDataFromTxtFile();
      Log.v("test", "ServiceGlobal DataLoad Complete by Txt File");
      return;
    }
    LoadCharacterDataFromImageName();
    Log.v("test", "ServiceGlobal DataLoad Complete by Image Name");
  }
  
  public static void ShowLoadDataByLog()
  {
    Log.v("test", "불러온 데이터 iWalk_Left\t\t\t: " + iWalk_Left);
    Log.v("test", "불러온 데이터 iWalk_Right\t\t\t: " + iWalk_Right);
    Log.v("test", "불러온 데이터 iWalkNum\t\t\t\t: " + iWalkNum);
    Log.v("test", "불러온 데이터 iWalkInterval\t\t\t: " + iWalkInterval);
    Log.v("test", "불러온 데이터 iTop\t\t\t\t\t: " + iTop);
    Log.v("test", "불러온 데이터 iTopMove\t\t\t\t: " + iTopMove);
    Log.v("test", "불러온 데이터 iTopMoveNum\t\t\t: " + iTopMoveNum);
    Log.v("test", "불러온 데이터 iTopMoveInterval\t\t: " + iTopMoveInterval);
    Log.v("test", "불러온 데이터 iLeft\t\t\t\t\t: " + iLeft);
    Log.v("test", "불러온 데이터 iRight\t\t\t\t: " + iRight);
    Log.v("test", "불러온 데이터 iLeft_Move\t\t\t: " + iLeft_Move);
    Log.v("test", "불러온 데이터 iRight_Move\t\t\t: " + iRight_Move);
    Log.v("test", "불러온 데이터 iLeftMoveNum\t\t\t: " + iLeft_MoveNum);
    Log.v("test", "불러온 데이터 iLeftMoveInterval\t\t: " + iLeft_MoveInterval);
    Log.v("test", "불러온 데이터 iDrop\t\t\t\t\t: " + iDrop);
    Log.v("test", "불러온 데이터 iTouch\t\t\t\t: " + iTouch);
    Log.v("test", "불러온 데이터 iAnimaPoseNumber\t\t: " + iAnimaPoseNumber);
    Log.v("test", "불러온 데이터 iAnimaPose00\t\t\t: " + iAnimaPose00);
    Log.v("test", "불러온 데이터 iAnimaPose00Num\t\t: " + iAnimaPose00Num);
    Log.v("test", "불러온 데이터 iAnimaPose00Interval\t: " + iAnimaPose00Interval);
    Log.v("test", "불러온 데이터 iAnimaPose00Loop\t\t: " + iAnimaPose00Loop);
    Log.v("test", "불러온 데이터 iAnimaPose01\t\t\t: " + iAnimaPose01);
    Log.v("test", "불러온 데이터 iAnimaPose01Num\t\t: " + iAnimaPose01Num);
    Log.v("test", "불러온 데이터 iAnimaPose01Interval\t: " + iAnimaPose01Interval);
    Log.v("test", "불러온 데이터 iAnimaPose01Loop\t\t: " + iAnimaPose01Loop);
    Log.v("test", "불러온 데이터 iAnimaPose02\t\t\t: " + iAnimaPose02);
    Log.v("test", "불러온 데이터 iAnimaPose02Num\t\t: " + iAnimaPose02Num);
    Log.v("test", "불러온 데이터 iAnimaPose02Interval\t: " + iAnimaPose02Interval);
    Log.v("test", "불러온 데이터 iAnimaPose02Loop\t\t: " + iAnimaPose02Loop);
    Log.v("test", "불러온 데이터 iAnimaPose03\t\t\t: " + iAnimaPose03);
    Log.v("test", "불러온 데이터 iAnimaPose03Num\t\t: " + iAnimaPose03Num);
    Log.v("test", "불러온 데이터 iAnimaPose03Interval\t: " + iAnimaPose03Interval);
    Log.v("test", "불러온 데이터 iAnimaPose03Loop\t\t: " + iAnimaPose03Loop);
    Log.v("test", "불러온 데이터 iAnimaPose04\t\t\t: " + iAnimaPose04);
    Log.v("test", "불러온 데이터 iAnimaPose04Num\t\t: " + iAnimaPose04Num);
    Log.v("test", "불러온 데이터 iAnimaPose04Interval\t: " + iAnimaPose04Interval);
    Log.v("test", "불러온 데이터 iAnimaPose04Loop\t\t: " + iAnimaPose04Loop);
    Log.v("test", "불러온 데이터 iAnimaPose05\t\t\t: " + iAnimaPose05);
    Log.v("test", "불러온 데이터 iAnimaPose05Num\t\t: " + iAnimaPose05Num);
    Log.v("test", "불러온 데이터 iAnimaPose05Interval\t: " + iAnimaPose05Interval);
    Log.v("test", "불러온 데이터 iAnimaPose05Loop\t\t: " + iAnimaPose05Loop);
    Log.v("test", "총 Bitmap의 갯수 : " + iSumOfBitmapNumber);
  }
  
  public static void initFunc1(int paramInt, service_TopView paramservice_TopView, long paramLong)
  {
    m_TopView = paramservice_TopView;
    StatePoint = paramInt;
    Timer = paramLong;
    TimerA = paramLong;
  }
  
  public static void initFunc2(service_Character paramservice_Character)
  {
    m_Character = paramservice_Character;
  }
}


/* Location:           D:\Tool\AndroidKiller_v1.3.1\projects\petdesigner\ProjectSrc\classes-dex2jar.jar
 * Qualified Name:     pck_Service01.service_ServiceGlobal
 * JD-Core Version:    0.7.0.1
 */